package com.google.code.teamtools.util;

import java.util.Date;

public class Duration 
{
	private Date start;
	private Date end;
	
	/**
	 * Create a <tt>Duration</tt> with no defined start and end date.
	 */
	public Duration() {}
	
	/**
	 * Create a duration with an immediate start date, and a defined end date.
	 * 
	 * @param end the end date
	 */
	public Duration(Date end) 
	{
		setStart(new Date());
		setEnd(end);
	}
	
	/**
	 * Create a duration with the defined start and end dates.
	 * 
	 * @param start the start date
	 * @param end the end date
	 */
	public Duration(Date start, Date end) 
	{
		setStart(start);
		setEnd(end);
	}
	
	/**
	 * Return the duration end date.
	 * 
	 * @return the end date
	 */
	public Date getEnd() 
	{
		return end;
	}
	
	/**
	 * Return the duration start date.
	 * 
	 * @return the start date
	 */
	public Date getStart() 
	{
		return start;
	}
	
	/**
	 * Set the end date of the duration.
	 * 
	 * @param end the end date to set
	 */
	public void setEnd(Date end) 
	{
		this.end = end;
	}

	/**
	 * Set the start date of the duration.
	 * 
	 * @param start the start date to set
	 */
	public void setStart(Date start) 
	{
		this.start = start;
	}
}
